An emerging development in computer organization is the use of data compression for the contents of main memory, that part of the random access memory hierarchy which is managed by the operating system ("OS") and where typically the unit of allocation is a page.
In compressed memory systems, a page may occupy a variable amount of physical memory space. For example, as described in the aforementioned related patent application, pages occupy or share a variable number of fixed size blocks; pages may be of nominal 4K size and blocks of size 256 bytes. Generally, the number of such blocks occupied by a page will vary with its contents, due to changes in compressibility.
Typically, each cache line is compressed prior to being written into memory, using a standard sequential or a parallel compression algorithm. Examples of compression algorithms include Lempel-Ziv coding and its generalizations, Huffman coding and arithmetic coding. See, for example, J. Ziv and A. Lempel, "A Universal Algorithm for Sequential Data Compression," IEEE Transactions on Information Theory, IT-23, pp. 337-343 (1977), which is hereby incorporated by reference in its entirety. A parallel approach is described in co-pending (allowed) U.S. patent application Ser. No. 08/498,948, entitled Parallel Compression and Decompression Using a Cooperative Dictionary, by Franaszek et al., filed on Jul. 6, 1995 ("Franaszek"). The Franaszek patent application is commonly assigned with the present invention to IBM Corporation, Armonk, N.Y. and is hereby incorporated herein by reference in its entirety. A convenient way to perform this compression is by automatically compressing the data using special-purpose hardware, with a minimum of intervention by the software or operating system. This permits compression/decompression to be done rapidly, avoiding what might otherwise be long delays associated with software compression/decompression.
Changes to a page stored in main memory occur on write backs from the cache. A changed cache line may require a larger number of blocks upon write back, than previously. If there are an insufficient number of free blocks to hold the changed line, the system abends. Thus, there is a need to maintain adequate free space under fluctuating compression efficiencies. The present invention addresses these needs.
Copending patent application Ser. No. 09/021,333 discloses a method for preventing system abends. That method requires that the hardware compression controller issue an emergency interrupt when the amount of physical free memory drops below a threshold T0 (blocks).
T0 is determined to be large enough so that physical memory cannot expand by more than T0 blocks during the process of stopping all processing except that required to free up a sufficient amount of memory (by zeroing pages for which a valid copy exists on disk, and/or paging out pages to disk and then zeroing them) to permit continued operation.
The present invention also requires generating an interrupt but improves upon that method by being easier to implement.